home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 22
/
Cream of the Crop 22.iso
/
program
/
snpd9611.zip
/
WB_FCOPY.C
< prev
next >
Wrap
Text File
|
1996-11-24
|
1KB
|
48 lines
.I 0 3
/* +++Date last modified: 28-Jul-1996 */
/*
.D 1 1
.I 3 1
** modified by: Bob Stout, Ray Gardner, and David Gersic
.D 4 3
.I 31 1
return Error_;
.D 32 1
.I 36 21
if (fdto >= 0)
{
if (Success_ == fdcopy(fdfrom, fdto))
{
close(fdto);
close(fdfrom);
return Success_;
}
else
{
close(fdto);
remove(to); /* delete any partial file */
}
}
close(fdfrom);
return Error_;
}
int fdcopy(int fdfrom, int fdto)
{
int bufsiz, retval = Error_;
.D 37 2
.I 53 1
if (n == -1) /* if error */
.D 54 1
.I 55 4
if (n == 0) /* if end of file */
{
retval = Success_;
break;
.D 56 6
.I 69 2
return retval;
}
.D 70 5